<?php
/**
 * 内容控制器
 * Date: 2025/11/05
 */

namespace App\Http\Controllers\Pc;

use App\Http\Controllers\BaseController;
use App\Services\Pc\ContentService;
use Illuminate\Http\Request;

class ContentController extends BaseController
{
    /**
     * 内容列表
     * @date 2025/11/05
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @throws \Illuminate\Validation\ValidationException
     */
    public function list()
    {
        return (new ContentService())->list();
    }

    /**
     * 内容详情
     * @date 2025/11/05
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function detail(Request $request)
    {
        $id = $request->input('id', 0);
        if (empty($id)) {
            return $this->failed('内容ID不能为空');
        }
        return (new ContentService())->detail($id);
    }
}
